<div id="RightCol">
<?
if($strStyleSheet == TRUE)
	echo "<table class='Normal' border='0' align='left' width='600'>";
?>
	<div class="Report">
	<tr>
		<td align='left' colspan='5'>
    		<h3>Order With Cost Report <?php echo ( date("H:i l, d F Y") );?></h3>
    	</td>
    </tr>
    
	<tr>
		<td>
			Order Date&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		</td>
		<td>
			Order #&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			
		</td>
		<td>				
			Product&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		</td><?
		if(isset($_REQUEST['boUnitPrice']) && ($_REQUEST['boUnitPrice'] == true))
		{?>
		<td>	
			Unit Price&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		</td><?
		}?>
		<td>
			Cost&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		</td>		
		
		<td>
			Quantity&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		</td>
		<td>
			Total Cost&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		</td>
	</tr>
	<?php
	$intPrevOrderYear = 0;
	$strOrderStatus = "";
	$intOrderStatus = 77;
	include (MODULE . "/action/qrySelectOrder_Status_With_Cost.php");
	//echo $strSQL;
	// If Category appears again in the loop create / populate the submenu
	// If Category and Sub-category are the same don't create sub-menus
	do {
		$intOrderYear = $myrow["OrderYear"];   
		$strOrderStatus = $myrow["OrderStatus"];?>
		<tr>
			<td>
				<?php echo ReformatFromMySQLDate($myrow["OrderDate"])?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			</td>
			<td>
				<?php echo "<a href='".ScreenURL("DisplayOrderHeader",array('intOrderHeaderID'=>$myrow["OrderHeaderID"]) )."' target='_blank'>".$myrow["OrderHeaderID"]."</a>"?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				
			</td><?
			if(isset($_REQUEST['boUnitPrice']) && ($_REQUEST['boUnitPrice'] == true))
			{?>
			<td>	
				<?=CURRENCY.number_format($myrow["UnitPrice"],2);?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			</td><?
			}?>
			<td>				
				<?php echo $myrow["Product"]?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			</td>
			<td>
				<?=CURRENCY.number_format($myrow["CostPrice"],2);?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			</td>		
			
			<td>
				<?=number_format($myrow["Quantity"]);?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			</td>
			<td>
				<?=number_format($myrow["CostPrice"] * $myrow["Quantity"],2);?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			</td>
		</tr>

		</div>
		<?php
		$intPrevOrderYear = $intOrderYear;	 
		$strPrevOrderStatus	= $strOrderStatus;
	 } while ($myrow = mysql_fetch_array($result));
	 
	if($strStyleSheet == TRUE){
   		echo "</table>";
	}
	?>

</div>
